Use the glib iconv wrappers.
authorAlexander Larsson <alexl@redhat.com>
Tue, 14 Nov 2000 10:09:21 +0000 (10:09 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Tue, 14 Nov 2000 10:09:21 +0000 (10:09 +0000)
2000-11-14  Alexander Larsson  <alexl@redhat.com>

* modules/linux-fb/basic.c:
Use the glib iconv wrappers.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
modules/linux-fb/basic.c

index 1c27276af4cdd1e5b6d3f36ccbfa5aa9e72107fe..fd3876c6333940b410015b1f502cdee174833dcc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-14  Alexander Larsson  <alexl@redhat.com>
+
+       * modules/linux-fb/basic.c:
+       Use the glib iconv wrappers.
+
 2000-11-13  Havoc Pennington  <hp@pobox.com>
 
        * demos/gtk-demo/textview.c: spiff up the demo a bit; reveals
index 1c27276af4cdd1e5b6d3f36ccbfa5aa9e72107fe..fd3876c6333940b410015b1f502cdee174833dcc 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-14  Alexander Larsson  <alexl@redhat.com>
+
+       * modules/linux-fb/basic.c:
+       Use the glib iconv wrappers.
+
 2000-11-13  Havoc Pennington  <hp@pobox.com>
 
        * demos/gtk-demo/textview.c: spiff up the demo a bit; reveals
index 1c27276af4cdd1e5b6d3f36ccbfa5aa9e72107fe..fd3876c6333940b410015b1f502cdee174833dcc 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-14  Alexander Larsson  <alexl@redhat.com>
+
+       * modules/linux-fb/basic.c:
+       Use the glib iconv wrappers.
+
 2000-11-13  Havoc Pennington  <hp@pobox.com>
 
        * demos/gtk-demo/textview.c: spiff up the demo a bit; reveals
index 1c27276af4cdd1e5b6d3f36ccbfa5aa9e72107fe..fd3876c6333940b410015b1f502cdee174833dcc 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-14  Alexander Larsson  <alexl@redhat.com>
+
+       * modules/linux-fb/basic.c:
+       Use the glib iconv wrappers.
+
 2000-11-13  Havoc Pennington  <hp@pobox.com>
 
        * demos/gtk-demo/textview.c: spiff up the demo a bit; reveals
index 1c27276af4cdd1e5b6d3f36ccbfa5aa9e72107fe..fd3876c6333940b410015b1f502cdee174833dcc 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-14  Alexander Larsson  <alexl@redhat.com>
+
+       * modules/linux-fb/basic.c:
+       Use the glib iconv wrappers.
+
 2000-11-13  Havoc Pennington  <hp@pobox.com>
 
        * demos/gtk-demo/textview.c: spiff up the demo a bit; reveals
index 1c27276af4cdd1e5b6d3f36ccbfa5aa9e72107fe..fd3876c6333940b410015b1f502cdee174833dcc 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-14  Alexander Larsson  <alexl@redhat.com>
+
+       * modules/linux-fb/basic.c:
+       Use the glib iconv wrappers.
+
 2000-11-13  Havoc Pennington  <hp@pobox.com>
 
        * demos/gtk-demo/textview.c: spiff up the demo a bit; reveals
index 1c27276af4cdd1e5b6d3f36ccbfa5aa9e72107fe..fd3876c6333940b410015b1f502cdee174833dcc 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-14  Alexander Larsson  <alexl@redhat.com>
+
+       * modules/linux-fb/basic.c:
+       Use the glib iconv wrappers.
+
 2000-11-13  Havoc Pennington  <hp@pobox.com>
 
        * demos/gtk-demo/textview.c: spiff up the demo a bit; reveals
index 38c6841dec7531e5d8f90bc921f36cf186a6e348..b4b8b14a0aec1cec2453d441bf5da2f3869edf61 100644 (file)
@@ -19,9 +19,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <iconv.h>
-
 #include <glib.h>
+#include <gconvert.h>
 #include <pango/pango.h>
 #include <pango/pango-utils.h>
 #include "gdkprivate-fb.h"
@@ -29,7 +28,7 @@
 PangoGlyph
 pango_fb_get_unknown_glyph(PangoFont *font)
 {
-  return FT_Get_Char_Index(PANGO_FB_FONT(font)->ftf, '~');
+  return FT_Get_Char_Index (PANGO_FB_FONT (font)->ftf, '~');
 }
 
 typedef struct _CharRange CharRange;
@@ -63,7 +62,7 @@ struct _CharCache
 #if 0
   MaskTable *mask_tables[256];
 #endif
-  iconv_t converters[MAX_CHARSETS];
+  GIConv converters[MAX_CHARSETS];
 };
 
 struct _Charset
@@ -143,7 +142,7 @@ char_cache_new (void)
   result = g_new0 (CharCache, 1);
 
   for (i=0; i < MAX_CHARSETS; i++)
-    result->converters[i] = (iconv_t)-1;
+    result->converters[i] = (GIConv)-1;
 
   return result;
 }
@@ -165,8 +164,8 @@ char_cache_free (CharCache *cache)
 #endif
 
   for (i=0; i<MAX_CHARSETS; i++)
-    if (cache->converters[i] != (iconv_t)-1)
-      iconv_close (cache->converters[i]);
+    if (cache->converters[i] != (GIConv)-1)
+      g_iconv_close (cache->converters[i]);
   
   g_free (cache);
 }
@@ -193,14 +192,14 @@ set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGl
   glyphs->glyphs[i].geometry.width = logical_rect.width;
 }
 
-static iconv_t
+static GIConv
 find_converter (CharCache *cache, Charset *charset)
 {
-  iconv_t cd = cache->converters[charset->index];
-  if (cd == (iconv_t)-1)
+  GIConv cd = cache->converters[charset->index];
+  if (cd == (GIConv)-1)
     {
-      cd = iconv_open  (charset->id, "UTF-8");
-      g_assert (cd != (iconv_t)-1);
+      cd = g_iconv_open  (charset->id, "UTF-8");
+      g_assert (cd != (GIConv)-1);
       cache->converters[charset->index] = cd;
     }
 
@@ -212,7 +211,7 @@ conv_8bit (CharCache  *cache,
           Charset *charset,
           const char *input)
 {
-  iconv_t cd;
+  GIConv cd;
   char outbuf;
   
   const char *inptr = input;
@@ -224,7 +223,7 @@ conv_8bit (CharCache  *cache,
   
   cd = find_converter (cache, charset);
 
-  iconv (cd, (const char **)&inptr, &inbytesleft, &outptr, &outbytesleft);
+  g_iconv (cd, (gchar **)&inptr, &inbytesleft, &outptr, &outbytesleft);
 
   return (guchar)outbuf;
 }
@@ -234,7 +233,7 @@ conv_euc (CharCache  *cache,
          Charset     *charset,
          const char *input)
 {
-  iconv_t cd;
+  GIConv cd;
   char outbuf[2];
 
   const char *inptr = input;
@@ -246,7 +245,7 @@ conv_euc (CharCache  *cache,
   
   cd = find_converter (cache, charset);
 
-  iconv (cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
+  g_iconv (cd, (gchar **)&inptr, &inbytesleft, &outptr, &outbytesleft);
 
   if ((guchar)outbuf[0] < 128)
     return outbuf[0];